// @ts-ignore
import { request } from '@/request/request';
import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";

/**
 * 商城支付.
 * {
 *     "orderId": 12,
 *     "method": "WeChat"
 * }
 * @param data
 */
export const initiateMallPayment = (data: any):Promise<any> => {
    return request({ url: '/mall/payment/initiatePayment', data, method: 'POST' })
}

/**
 * 订单列表.
 * @param data
 */
export const getMallOrderList = (data: any):Promise<any>  => {
    return request({ url: '/mall/order/orders', data, method: 'GET' })
}


/**
 * 订单详情.
 * @param data
 */
export const getMallOrderInfo = (data: any):Promise<any> => {
    return request({ url: '/mall/order/detail', data, method: 'GET' })
}

/**
 * 取消商城订单.
 * @param data
 */
export const cancellationMallOrder = (data: any):Promise<any> => {
    return request({ url: '/mall/order/cancellation', data, method: 'POST' })
}

/**
 * 确认收货.
 * @param data
 */
export const confirmMallDelivery = (data: any):Promise<any> => {
    return request({ url: '/mall/order/confirmDelivery', data, method: 'POST' })
}

/**
 * 发表订单评价.
 * @param data
 */
export const publishMallOrderComment = (data: any):Promise<any> => {
    return request({ url: '/mall/order/publishComment', data, method: 'POST' })
}
